{template header}

    <div class="box">
    <!--{if $a == 'index'}-->
        {template title}

        <table cellpadding="1" cellspacing="1" width="100%" border="0">
            <tr>
                <th width="15%">分类
                <th>标题</th>
                <th width="7%">评论</th>
                <th width="7%">浏览</th>
                <th width="13%">操作</th>
            </tr>

        <!--{if $result[ 'result' ]}-->
            <!--{loop $result['result'] $val}-->
            <tr>
                <td>
                    [ <a class="over1" href="{$this->url($c, null, array('sid' => $val['sid']))}">{$this->sort[$val['sid']]['title']}</a> ]
                </td>
                <td class="td2 subject">
                    <a href="{$this->url($c, 'edit', array('id' => $val['id'], 'type' => $val['model']))}" title="{$val['title']}">
                        {$this->get_title($val['title'])}</a><span class='date'>{echo formatDate($val['dateline'])}</span>
                    <!--{if $val['isTop']}--><span style="color: blue;">[置顶]</span><!--{/if}-->
                </td>
                <td>{$val['comments']}</td>
                <td>{$val['views']}</td>
                <td>
                    <div class="btn-group">
                        <a class="btn btn-mini btn-info" title="{$this->top[$val['isTop']]}" href="{$this->url($c, 'top', array('id' => $val['id'], 'v' => $val['isTop'], 'type' => $val['model'] ) )}">{$this->top[$val['isTop']]}</a>
                    </div>
                    <div class="btn-group">
                        <a title="删除{$this->name}" class="del btn btn-mini btn-danger" href="{$this->url($c, 'del', array('id' => $val['id'], 'type' => $val['model']))}">删除</a>
                    </div>
                </td>
            </tr>
            <!--{/loop}-->
        <!--{else}-->
            <tr>
                <td colspan="5">没有{$this->name}!</td>
            </tr>
        <!--{/if}-->
            <tr>
                <td colspan="5"><a class="btn btn-success" href="{$this->url($c, 'add', array('type' => $this->type) )}">添加{$this->name}</a></td>
            </tr>
        </table>
        <!--{if $result[ 'page' ]}-->
        <div class="navi top">
            <div class="page">{$result[ 'page' ]}</div>
            <div class="search">
                <form action="{$this->url($c, null, $this->get('key'))}">
                    <input type="text" name="key" class="span3" placeholder="请输入{$this->name}名称" />
                    <button type="button" class="btn">搜索</button>
                </form>
            </div>
            <div class="clear"></div>
        </div>
        <!--{/if}-->
    <!--{/if}-->
    <!--{if $a == 'add' || $a == 'edit' }-->
    <form method="post" action="{$this->url($c, 'save', array('id' => $result['id']))}">
        <input type="hidden" name="{$c}[model]" value="{$this->type}" />
        <input type="hidden" name="{$c}[uid]" value="{$this->admin['id']}" />
        <input type="hidden" name="attach[id]" value="" />
        <table cellpadding="1" cellspacing="1" width="100%" border="0">
            <tr>
                <td width="25%">{$this->name}名称：</td>
                <td class="td2">
                    <input type="text" name="{$c}[title]" placeholder="请输入{$this->name}名称" class="required span5" value="{$a == 'edit' ? $result['title'] : ''}" />
                </td>
            </tr>
            <tr>
                <td>{$this->name}分类：</td>
                <td class="td2">
                    <select name="{$c}[sid]" class="sid">
                    <!--{if $this->sort}-->
                        <!--{loop $this->sort $tree}-->
                        <option value="{$tree['id']}"{$tree['id'] == $result['sid'] ? ' selected' : ''}>{$tree['treeTitle']}</option>
                        <!--{/loop}-->
                    <!--{else}-->
                        <option value="0">未分类</option>
                    <!--{/if}-->
                    </select>
                </td>
            </tr>
            <tr>
                <td>{$this->name}地址：</td>
                <td class="td2">
                    <input type="text" name="{$c}[alias]" class="span4{$this->type == 'link' ? ' required' : ''}" value="{$a == 'edit' ? $result['alias'] : ''}" />
                </td>
            </tr>
            <tr>
                <td>发布时间：</td>
                <td class="td2">
                    <input type="text" id="dateline" name="{$c}[dateline]" value="{$a == 'edit' ? date($this->setting['timeformat'], $result['dateline']) : date($this->setting['timeformat'], time())}" readonly />
                    <span class="lable"><a href="" class="dateline btn btn-small">插入当前时间</a></span>
                </td>
            </tr>
            <tr>
                <td>{$this->name}排序 ：</td>
                <td class="td2">
                    <input type="text" name="{$c}[oid]" class="span1" value="{$a == 'edit' ? $result['oid'] : ''}" />
                    <span class="lable">数值越大越靠前显示</span>
                </td>
            </tr>
            <tr>
                <td>选项：</td>
                <td class="td2">
                    <label class="checkbox inline">
                        <input type="checkbox" name="{$c}[isTop]" value="1"{$a == 'edit' && $result['isTop'] ? 'checked' : ''} />置顶
                    </label>
                    <label class="checkbox inline">
                        <input type="checkbox" name="{$c}[isHide]" value="1"{$a == 'edit' && $result['isHide'] ? 'checked' : ''} />隐藏
                    </label>
                </td>
            </tr>
            <tr>
                <td colspan="2" class="td3">
                    <a title="保存{$this->name}" class="btn btn-success save" href="{$this->url($c, null, array('type' => $this->type))}">保 存</a>
                </td>
            </tr>
        </table>
    </form>
    <!--{/if}-->
    </div>
{template footer}